home *** CD-ROM | disk | FTP | other *** search
/ Clickx 75 / Clickx 75.iso / software / expressionweb / expressionwebv3 / ExpressionWeb_en.exe / Setup / WeLocen.cab / Microsoft.Expression.Web.Help.en / scripts / splitscreen.js < prev   
Encoding:
Text File  |  2009-06-19  |  998 b   |  30 lines

  1.  
  2.     function SplitScreen (nonScrollingRegionId, scrollingRegionId) {
  3.  
  4.         // store references to the two regions
  5.         this.nonScrollingRegion = document.getElementById(nonScrollingRegionId);
  6.         this.scrollingRegion = document.getElementById(scrollingRegionId);
  7.  
  8.         // set the scrolling settings
  9.         document.body.style.margin = "0px";
  10.         document.body.style.overflow = "hidden";
  11.         this.scrollingRegion.style.overflow = "auto";
  12.  
  13.         // fix the size of the scrolling region
  14.         this.resize(null);
  15.  
  16.         // add an event handler to resize the scrolling region when the window is resized        
  17.         registerEventHandler(window, 'resize', getInstanceDelegate(this, "resize"));
  18.  
  19.     }
  20.  
  21.     SplitScreen.prototype.resize = function(e) {
  22.         var height = document.body.clientHeight - this.nonScrollingRegion.offsetHeight;
  23.         if (height > 0) {
  24.             this.scrollingRegion.style.height = height;
  25.         } else {
  26.             this.scrollingRegion.style.height = 0;
  27.         }
  28.         this.scrollingRegion.style.width = document.body.clientWidth;
  29.     }
  30.